#include <cxxtest/TestSuite.h>
#include "ProjectAllocation.hpp"

  class TestProjetcAllocationAlgorithm : public CxxTest::TestSuite
  {
  public:

	  /**
	   * 3 students, 4 projects
	   */
      void testSimpleCase( void )
      {
          DeptMan::Student st_1("john smith");
          std::vector<unsigned> pref_proj = {4,1,3,2};
          st_1.SetPreferredProjects(pref_proj);
          st_1.SetCAP(3.5);

          DeptMan::Student st_2("bob");
          std::vector<unsigned> pref_proj_2 = {4,3,2,1};
          st_2.SetPreferredProjects(pref_proj_2);
          st_2.SetCAP(3.6);

          DeptMan::Student st_3("robert");
          std::vector<unsigned> pref_proj_3 = {4,2,1,3};
          st_3.SetPreferredProjects(pref_proj_3);
          st_3.SetCAP(4.5);

          DeptMan::Student st_4("james");
          std::vector<unsigned> pref_proj_4 = {1,2,3,4};
          st_4.SetPreferredProjects(pref_proj_4);
          st_4.SetCAP(2.5);

          std::vector<DeptMan::Student> stn = {st_1,st_2,st_3,st_4};
          AllocateStudents(stn);
          TS_ASSERT_EQUALS(st_1.GetAllocatedProjectNumber(), 1);
          TS_ASSERT_EQUALS(st_2.GetAllocatedProjectNumber(), 3);
          TS_ASSERT_EQUALS(st_3.GetAllocatedProjectNumber(), 4);
          TS_ASSERT_EQUALS(st_4.GetAllocatedProjectNumber(), 2);


      }
  };
